#include "MpiGroup.h"
#include "MpiException.h"

#include <cassert>

using namespace SG::Algebra;

//=============================================================================
// MpiGroup

MpiGroup::MpiGroup (const MPI_Group& group)
    : mGroup(group)
{

}

MpiGroup::~MpiGroup ()
{

}

int MpiGroup::rank ()
{
    int rank;
    MPI_CHECK_RESULT (MPI_Group_rank, (mGroup, &rank));

    return rank;
}

int MpiGroup::size ()
{
    int size;

    MPI_CHECK_RESULT (MPI_Group_size, (mGroup, &size));

    return size;
}